<!--正文导航-->
<!DOCTYPE html>
<html lang="zh-cn">
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black"/>
<meta content="telephone=no" name="format-detection" /> 
<style>
	body > a:first-child,body > a:first-child img{ width: 0px !important; height: 0px !important; overflow: hidden; position: absolute}
	body{padding-bottom: 0 !important;}
</style>
<meta id="viewport" name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0">
<title>缴费中心</title>
<link rel="stylesheet" href="{OSSURL}public/mobile/css/reset.css">
{php echo register_jssdk();}
<script src="{OSSURL}public/mobile/js/jquery.js"></script>
<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
<script type="text/javascript" src="{OSSURL}public/mobile/js/PromptBoxUtil.js?v=4.80309"></script>
</head>
<body>
<style>
.order_sum li > span{ float:left; padding-left: 24px; background: url({OSSURL}public/mobile/img/user-uc.png) no-repeat center left; background-size: 19px;}
.order_sum li > span.click{ background-image: url({OSSURL}public/mobile/img/user-c.png);}
.unpay_li{ position: relative; padding: 10px 23px 10px 39px; margin-top: 10px; background-color: #fff; border-top:1px solid #ccc;border-bottom:1px solid #ccc; background:#fff url({OSSURL}public/mobile/img/user-uc.png) no-repeat 10px center; background-size: 19px; color: #828282;}
.unpay_li.click{counter-increment:item;background-image: url({OSSURL}public/mobile/img/user-c.png);counter-increment:item;}
</style>
    <div id="wrap" class="user_order">
        <header id="header">
            <ul class="order">
				<li class="order_li all_g"><a href="javascript:void(0)">全部</a></li>
                <li class="order_li no_g"><a href="javascript:void(0)" {if $rest != 0}value = "{$rest}"{/if} id="no_g">待缴费</a></li>
                <li class="order_li yes_g"><a href="javascript:void(0)">已缴费</a></li>
                <li class="order_li cancel_g"><a href="javascript:void(0)">已退费</a></li>
            </ul>			
        </header>
        <section id="order_list">
            <!-- 全部 -->
            <section class="order_all all_g">
				{if !empty($list)}
				    {loop $list $item}
						{if $item['type'] ==1}
						<a href="{if $item['status'] == 2}{php echo $this->createMobileUrl('mykcinfo', array('id' => $item['kcid'], 'schoolid' =>$schoolid), true)}{else}{php echo $this->createMobileUrl('kcinfo', array('id' => $item['kcid'], 'schoolid' =>$schoolid), true)}{/if}">
							<dl class="order_cnt">
								<dt><div style="background-image:url({php echo tomedia($item['ticon']);})"></div>{$item['tname']}</dt>
								<dd>{$item['kcname']}</dd>
								<dd>{$item['adrr']}</dd>
								<dd>金额:{$item['cose']}元&nbsp;订单号:{$item['id']}</dd>
								<dd>课程开始:{php echo date('Y-m-d',$item['kcstart'])}</dd>
								<dd>课程结束:{php echo date('Y-m-d',$item['kcend'])}</dd>
								<dd>付费时间:{if empty($item['paytime'])}未付费{else}{php echo date('Y-m-d h:m:s',$item['paytime'])}{/if}</dd>
								<!-- 三种状态分别是order_ready、order_unready、order_over -->
								{if $item['kcstart']>TIMESTAMP}
								<div class="order_static order_unready"></div>
								{else if $item['kcstart']<TIMESTAMP && $item['kcend']<TIMESTAMP}
								<div class="order_static order_ready"></div>
								{else if TIMESTAMP<$item['kcend']}
								<div class="order_static order_over"></div>
								{/if}
								{if $item['status'] == 1}
								<div class="order_static1 order_unready1"></div>
								{else if $item['status'] == 2}
								<div class="order_static1 order_ready1"></div>
								{else if $item['status'] == 3}
								<div class="order_static1 order_ok1"></div>
								{/if}
							</dl>
						</a>
						{/if}
						{if $item['type'] ==3}
								{if $item['is_time'] == 1}
									<a href="{php echo $this->createMobileUrl('obinfo', array('id' => $item['costid'], 'schoolid' =>$schoolid), true)}">
										<dl class="order_cnt">
											<dt><div style="background-image:url({php echo tomedia($item['obicon']);})"></div>{$school['title']}</dt>
											<dd>{$item['obname']}</dd>
											<dd>金额:{$item['cose']}元&nbsp;订单号:{$item['id']}</dd>
											<dd>有效时间范围</dd>
											<dd>开始:{php echo date('Y-m-d',$item['obstart'])}</dd>
											<dd>截至:{php echo date('Y-m-d',$item['obend'])}</dd>
											<dd>付费时间:{if empty($item['paytime'])}未付费{else}{php echo date('Y-m-d h:m:s',$item['paytime'])}{/if}</dd>									
											{if $item['status'] == 1}
											<div class="order_static1 order_unready1"></div>
											{else if $item['status'] == 2}
											<div class="order_static1 order_ready1"></div>
											{else if $item['status'] == 3}
											<div class="order_static1 order_ok1"></div>
											{/if}
										</dl>
									</a>
								{else}
									{php $time = $item['obtime'] * 86400; $times = $time + $item['paytime']; $rest = $times - TIMESTAMP; $restday = floor($rest/86400);}
									<a {if $restday < 0 && $item['status'] ==2}{if $item['xufeitype']==2}onclick="gopay({$item['id']});"{/if}{else}href="{php echo $this->createMobileUrl('obinfo', array('id' => $item['costid'], 'schoolid' =>$schoolid), true)}"{/if}>
										<dl class="order_cnt">
											<dt><div style="background-image:url({php echo tomedia($item['obicon']);})"></div>{$school['title']}</dt>
											<dd>{$item['obname']}</dd>
											<dd>金额:{$item['cose']}元&nbsp;订单号:{$item['id']}</dd>		
											<dd>付费时间:{php echo date('Y-m-d h:m:s',$item['paytime'])}</dd>									
											<dd>剩余时间:{if $restday > 0}{$restday}天{else}已到期{/if}</dd>
												{if $restday < 0 && $item['status'] ==2}
													{if $item['xufeitype']==2}
													<div class="order_static order_xufei"></div>
													{/if}
												{/if}										
											{if $item['status'] == 1}
											<div class="order_static1 order_unready1"></div>
											{else if $item['status'] == 2}
											<div class="order_static1 order_ready1"></div>
											{else if $item['status'] == 3}
											<div class="order_static1 order_ok1"></div>
											{/if}
										</dl>
									</a>
								{/if}
						{/if}
						{if $item['type'] ==4}	
						<a href="#">
							<dl class="order_cnt">
								<dt><div style="background-image:url({php echo tomedia($school['logo']);})"></div>{$school['title']}</dt>
								<dd>报名费</dd>
								<dd>金额:{$item['cose']}元&nbsp;订单号:{$item['id']}</dd>
								<dd>付费时间:{php echo date('Y-m-d h:m:s',$item['paytime'])}</dd>
								{if $item['status'] == 1}
								<div class="order_static1 order_unready1"></div>
								{else if $item['status'] == 2}
								<div class="order_static1 order_ready1"></div>
								{else if $item['status'] == 3}
								<div class="order_static1 order_ok1"></div>
								{/if}
							</dl>
						</a>							
						{/if}
						{if $item['type'] ==5}	
						<a href="#">
							<dl class="order_cnt">
								<dt><div style="background-image:url({php echo tomedia($school['logo']);})"></div>{$school['title']}</dt>
								<dd>考勤卡费</dd>
								<dd>金额:{$item['cose']}元&nbsp;订单号:{$item['id']}</dd>
								<dd>付费时间:{php echo date('Y-m-d h:m:s',$item['paytime'])}</dd>
								{if $item['status'] == 1}
								<div class="order_static1 order_unready1"></div>
								{else if $item['status'] == 2}
								<div class="order_static1 order_ready1"></div>
								{else if $item['status'] == 3}
								<div class="order_static1 order_ok1"></div>
								{/if}
							</dl>
						</a>
						{/if}								
					{/loop}	
				{else}	
					<section class="order_null" style="z-index:999;">
							<p>您还没任何已缴费项目哦~</p>
					</section>
				{/if}				
            </section>
            <!-- 待缴费 -->
            <section class="order_unpay no_g">
			        {loop $list $item}
					{if $item['status'] == 1}
						{if $item['type'] == 1}
                        <div class="">
                            <dl class="unpay_li" val="{$item['id']}">
                                <dt><div style="background-image:url({php echo tomedia($item['ticon']);})"></div>{$item['tname']}</dt>
                                <dd>{$item['kcname']}</dd>
                                <!-- value中是剩余名额 -->
								{php $datas = pdo_fetchcolumn("select count(*) FROM ".tablename('wx_school_order')." WHERE kcid = '".$item['id']."' And status = 2 "); $rest = $item['minge'] - $datas - $item['yibao'];}
                                <dd value="{if $rest > 0}{$rest}个名额{else}0个名额{/if}">{$item['cose']}</dd>
                                <dd>{$item['adrr']}</dd>
                                <dd>开始:{php echo date('Y-m-d',$item['kcstart'])}</dd>
                                <dd>结束:{php echo date('Y-m-d',$item['kcend'])}</dd>
                                <input type="hidden" value="{$item['id']}" class="coupon_cid"/>
                                <div class="order_close" style="background-image:url({OSSURL}public/mobile/img/mask_close.png)"></div>
                            </dl>
                            <p class="order_time">请于{php echo date('Y年m月d日',$item['kcstart'])}之前缴费哦~</p>
                            <div class="mask"></div>
                        </div>
						{else if $item['type'] == 5}
                        <div class="">
                            <dl class="unpay_li" val="{$item['id']}">
                                <dt><div style="background-image:url({php echo tomedia($school['logo']);})"></div>{$school['title']}</dt>
                                <dd>考勤卡费</dd>
                                <!-- value中是剩余名额 -->
								<dd>{$item['cose']}元</dd>
								{if $card['cardtime'] ==1}
								<dd>续费时长:{$card['endtime1']}天</dd>
								{else}
								<dd>有效时间:至{php echo date('Y年m月d日',$card['endtime2'])}</dd>
								{/if}
                                <input type="hidden" value="{$item['id']}" class="coupon_cid"/>
                                <div class="order_close" style="background-image:url({OSSURL}public/mobile/img/mask_close.png)"></div>
                            </dl>
                            <p class="order_time">{if $card['cardtime'] ==1}续费后可以使本功能延长{$card['endtime1']}天{else}续费后可以使本功能至{php echo date('Y年m月d日',$card['endtime2'])}{/if}</p>
                            <div class="mask"></div>
                        </div>					
						{else}
                        <div class="">
                            <dl class="unpay_li" val="{$item['id']}">
                                <dt><div style="background-image:url({php echo tomedia($item['obicon']);})"></div>{$school['title']}</dt>
                                <dd>{$item['obname']}</dd>			
                                <dd>{$item['cose']}</dd>
									{if $item['is_time'] == 1}
									<dd>有效时间范围</dd>
                                    <dd>开始:{php echo date('Y-m-d',$item['obstart'])}</dd>
                                    <dd>截至:{php echo date('Y-m-d',$item['obend'])}</dd>
									{else}								
									<dd>有效时长:{$item['obtime']}天</dd>
									{/if}
                                <input type="hidden" value="{$item['id']}" class="coupon_cid"/>                                
                            </dl>
                            <p class="order_time">请于{php echo date('Y年m月d日',$item['obstart'])}之前缴费哦~</p>
                            <div class="mask"></div>
                        </div>
						{/if}
					{/if}	
					{/loop}	
                <ul class="order_sum">
                    <li><span id="quanxuan">全选</span>未付（<b></b>个)</li>
                    <li><div class="btn" {if empty($userinfo['name']) || empty($userinfo['name'])}onclick="Sigeup()"{else}id="jiesuan"{/if}>去结算</div></li>
                </ul>
            </section>
            <!-- 已缴费 -->
            <section class="order_payed yes_g">
			        {if !empty($list)}
			            {loop $list $item}
							{if $item['status'] == 2}
								{if $item['type'] == 1}
								<a href="{php echo $this->createMobileUrl('mykcinfo', array('id' => $item['kcid'], 'schoolid' =>$schoolid), true)}">
									<dl class="order_cnt">
										<dt><div style="background-image:url({php echo tomedia($item['ticon']);})"></div>{$item['tname']}</dt>
										<dd>{$item['kcname']}</dd>
										<dd>金额:{$item['cose']}元&nbsp;订单号:{$item['id']}</dd>
										<dd>开始:{php echo date('Y-m-d',$item['kcstart'])}</dd>
										<dd>结束:{php echo date('Y-m-d',$item['kcend'])}</dd>
										<!-- 三种状态分别是order_ready、order_unready、order_over -->
										{if $item['kcstart']>TIMESTAMP}
										<div class="order_static order_unready"></div>
										{else if $item['kcstart']<TIMESTAMP && $item['kcend']<TIMESTAMP}
										<div class="order_static order_ready"></div>
										{else if TIMESTAMP<$item['kcend']}
										<div class="order_static order_over"></div>
										{/if}
										{if $item['status'] == 1}
										<div class="order_static1 order_unready1"></div>
										{else if $item['status'] == 2}
										<div class="order_static1 order_ready1"></div>
										{else if $item['status'] == 3}
										<div class="order_static1 order_ok1"></div>
										{/if}
									</dl>
								</a>
								{else if $item['type'] == 5}
								<a>
									<dl class="order_cnt">
										<dt><div style="background-image:url({php echo tomedia($school['logo']);})"></div>{$school['title']}</dt>
										<dd>考勤卡费</dd>
										<!-- value中是剩余名额 -->
										<dd>金额:{$item['cose']}元&nbsp;订单号:{$item['id']}</dd>
										<dd>付费时间:{php echo date('Y-m-d h:m:s',$item['paytime'])}</dd>
										{if $item['status'] == 1}
										<div class="order_static1 order_unready1"></div>
										{else if $item['status'] == 2}
										<div class="order_static1 order_ready1"></div>
										{else if $item['status'] == 3}
										<div class="order_static1 order_ok1"></div>
										{/if}
									</dl>
								</a>
								{else}
									{if $item['is_time'] == 1}
										<a href="{php echo $this->createMobileUrl('obinfo', array('id' => $item['costid'], 'schoolid' =>$schoolid), true)}">
											<dl class="order_cnt">
												<dt><div style="background-image:url({php echo tomedia($item['obicon']);})"></div>{$school['title']}</dt>
												<dd>{$item['obname']}</dd>
												<dd>金额:{$item['cose']}元&nbsp;订单号:{$item['id']}</dd>
												<dd>有效时间范围</dd>
												<dd>开始:{php echo date('Y-m-d',$item['obstart'])}</dd>
												<dd>截至:{php echo date('Y-m-d',$item['obend'])}</dd>
												<dd>付费时间:{if empty($item['paytime'])}未付费{else}{php echo date('Y-m-d h:m:s',$item['paytime'])}{/if}</dd>									
												{if $item['status'] == 1}
												<div class="order_static1 order_unready1"></div>
												{else if $item['status'] == 2}
												<div class="order_static1 order_ready1"></div>
												{else if $item['status'] == 3}
												<div class="order_static1 order_ok1"></div>
												{/if}
											</dl>
										</a>
								    {else}
										{php $time = $item['obtime'] * 86400; $times = $time + $item['paytime']; $rest = $times - TIMESTAMP; $restday = floor($rest/86400);}
										<a {if $restday < 0}{if $item['xufeitype']==2}onclick="gopay({$item['id']});"{/if}{else}href="{php echo $this->createMobileUrl('obinfo', array('id' => $item['costid'], 'schoolid' =>$schoolid), true)}"{/if}>
											<dl class="order_cnt">
												<dt><div style="background-image:url({php echo tomedia($item['obicon']);})"></div>{$school['title']}</dt>
												<dd>{$item['obname']}</dd>
												<dd>金额:{$item['cose']}元&nbsp;订单号:{$item['id']}</dd>	
												<dd>付费时间:{php echo date('Y-m-d h:m:s',$item['paytime'])}</dd>									
												<dd>剩余时间:{if $restday > 0}{$restday}天{else}已到期{/if}</dd>
												{if $restday < 0}
													{if $item['xufeitype']==2}
													<div class="order_static order_xufei"></div>
													{/if}
												{/if}									
												{if $item['status'] == 1}
												<div class="order_static1 order_unready1"></div>
												{else if $item['status'] == 2}
												<div class="order_static1 order_ready1"></div>
												{else if $item['status'] == 3}
												<div class="order_static1 order_ok1"></div>
												{/if}
											</dl>
										</a>
									{/if}	
								{/if}
							{/if}	
						{/loop}				
					{else}	
						<section class="order_null">
								<p>您还没任何未缴项目哦~</p>
						</section>
					{/if}
            </section>
            <!-- 已退费 -->
            <section class="order_refund cancel_g">                                   
			        {if !empty($list)}
			            {loop $list3 $item}
							{if $item['status'] == 3}
								{if $item['type'] == 1}
								<a href="{php echo $this->createMobileUrl('kcinfo', array('id' => $item['kcid'], 'schoolid' =>$schoolid), true)}">
									<dl class="order_cnt">
										<dt><div style="background-image:url({php echo tomedia($item['ticon']);})"></div>{$item['tname']}</dt>
										<dd>{$item['kcname']}</dd>
										<dd>金额:{$item['cose']}元&nbsp;订单号:{$item['id']}</dd>
										<dd>开始:{php echo date('Y-m-d',$item['kcstart'])}</dd>
										<dd>结束:{php echo date('Y-m-d',$item['kcend'])}</dd>
										<!-- 三种状态分别是order_ready、order_unready、order_over -->
										{if $item['kcstart']>TIMESTAMP}
										<div class="order_static order_unready"></div>
										{else if $item['kcstart']<TIMESTAMP && $item['kcend']<TIMESTAMP}
										<div class="order_static order_ready"></div>
										{else if TIMESTAMP<$item['kcend']}
										<div class="order_static order_over"></div>
										{/if}
										{if $item['status'] == 1}
										<div class="order_static1 order_unready1"></div>
										{else if $item['status'] == 2}
										<div class="order_static1 order_ready1"></div>
										{else if $item['status'] == 3}
										<div class="order_static1 order_ok1"></div>
										{/if}
									</dl>
								</a>
								{else}
								<a href="{php echo $this->createMobileUrl('obinfo', array('id' => $item['costid'], 'schoolid' =>$schoolid), true)}">
									<dl class="order_cnt">
										<dt><div style="background-image:url({php echo tomedia($item['obicon']);})"></div></dt>
										<dd>{$item['obname']}</dd>
										<dd>金额:{$item['cose']}元&nbsp;订单号:{$item['id']}</dd>
										<dd>退费时间:{if !empty($item['tuitime'])}{php echo date('Y-m-d h:m:s',$item['tuitime'])}{/if}</dd>
										{if $item['status'] == 1}
										<div class="order_static1 order_unready1"></div>
										{else if $item['status'] == 2}
										<div class="order_static1 order_ready1"></div>
										{else if $item['status'] == 3}
										<div class="order_static1 order_ok1"></div>
										{/if}
									</dl>
								</a>
								{/if}
							{/if}	
						{/loop}					
					{else}	
						<section class="order_null">
							<p>您还没任何退费项目哦~</p>
						</section>
					{/if}
            </section>			
        </section>
        <div id="mask" style="display:none;background:;">
            <div class="dialoge" id="delete" style="display:none;">
                <div class="dialoge_close"></div>
                <h1>请问您确定要删除吗？</h1>
                <a class="dialoge_close" href="javascript:void(0)">取消</a>
                <a class="dialoge_ture" href="javascript:void(0)">确定</a>
            </div>
            <div class="dialoge" id="dialoge_inf" style="display:none">
                <div class="dialog_close"></div>
                <span>您还没有在读班级哦</span>        		
            </div>
        </div>		
    </div>
    <div class="user_info" id="user_info" style="display:none;">
	   <div style="border-radius: 5%;">
            <ul>
				<p>请完善联系方式</p>
                    <li class="user_name">
                        <input type="text" placeholder="请输入您的姓名" name ="name" id="name" value="{if !empty($userinfo['name'])}{$userinfo['name']}{/if}">
                        真实姓名
                    </li>
                    <li class="user_name">
                        <input type="text" placeholder="请输入您的手机号" name ="mobile" id="mobile" value="{if !empty($userinfo['mobile'])}{$userinfo['mobile']}{/if}">
                        手机号
                    </li>
					<li class="user_name">是否接收其他家长发送的信息
						<select id="is_allowmsg">
							<option value="1">允许</option>
							<option value="2">拒绝</option>
						</select>
					</li>					
                     <div class="btn" onclick="Tijiao();">提交</div>
            </ul>
					<span id="close" onclick="Close();">×</span>
	   </div>
    </div>	
	<input id="userid" name="userid" type="hidden" value="{$it['id']}">
	<input id="umobile" name="umobile" type="hidden" value="{$userinfo['mobile']}">
	<input id="uname" name="uname" type="hidden" value="{$userinfo['name']}">	
	{php include $this->template('footer');} 
</body>

<script>
var PB = new PromptBox();
var userid =  $("#userid").val(); 
$(function() {
 WeixinJSHideAllNonBaseMenuItem();	
 $('.all_g').remove('select');
 $('.no_g').remove('select');
 $('.yes_g').remove('select');
 $('.cancel_g').remove('select');
	var select_div = '{$_GPC['op']}';
	if (select_div == '') {
		select_div = 'no_g';
	}
	$("." + select_div).addClass('select');

	if ($('.unpay_li').length == '0') {
	   $('.order_sum').hide();
	}
});
function gopay(id){
	var submitData = {
				weid:"{$weid}",
				schoolid:"{$schoolid}",
				openid:"{$openid}",
				id:id,
	};
	var truthBeTold = window.confirm('确认要续费吗?'); 
	if (truthBeTold) {
		$.post("{php echo $this->createMobileUrl('payajax',array('op'=>'xufeiob'))}",submitData, function(data) {
			if (data.result) {
				location.href = data.msg;
			} else {
				alert(data.msg);
			}
		},'json');
	}
} 
$(function() { 
	var ua = navigator.userAgent.toLowerCase();
	var browserType = '';
	if (ua.match(/MicroMessenger/i) == "micromessenger") {
		browserType = "touchstart";
	}else if(ua.indexOf('iphone') > -1 || ua.indexOf('Android') > -1 || ua.indexOf('Linux') > -1 || ua.indexOf('Mac') > -1){
		browserType = "touchstart";
	}else{
		browserType = "click";
	}
	$('#jiesuan').bind('click', function() {
		var arr = new Array();
		var j = 0;
		for (var i = 0; i < $('.unpay_li').length; i++) {
			if ($('.unpay_li').eq(i).hasClass('click')) {
				arr[j] = $('.unpay_li').eq(i).attr('val');
				j++;
			}
		}
		var str = arr.join(',');
		if (str == '') {
			alert('请先选择结算项目！');
			return false;
		}
		if (j++ > 1) {
			alert('抱歉,为了资金安全,请逐个订单支付！');
			return false;
		}			
		window.location.href = "{php echo $this->createMobileUrl('gopay', array('schoolid' => $schoolid),true)}" + "&str=" + str;
	});
});
//删除
function deleteClass(cid, stuid) {
	var submitData = {
				schoolid : "{$schoolid}",
				weid     : "{$_W['uniacid']}",
				openid   : "{$openid}",
				uid      : "{$fan['uid']}",
				kcid     : cid,
				sid      : stuid
	};
	$.post("{php echo $this->createMobileUrl('payajax',array('op'=>'deleteclass'))}",submitData, function(data) {
		if (data.result) {
			var val = $('#no_g').attr('value');
			$('#no_g').attr('value', val - 1);
			$('#mask').hide();
		} else {
			$('#mask').show();
			$('#dialoge_inf').html('<span>' + data.msg + '</span>');
			$('#dialoge_inf').show();
		}
	},'json');

}
$(document).ready(function(e) {
	$(".order > li").bind("click", function() {
		if ($(this).hasClass("select"))
			return;
		var _index = $(this).index();
		$(this).addClass("select").siblings(".select").removeClass("select");
		$("#order_list > section").eq(_index).addClass("select").siblings(".select").removeClass("select");
	})
	var _list = 0;
	
	var ua = navigator.userAgent.toLowerCase();
	var browserType = '';
	if (ua.match(/MicroMessenger/i) == "micromessenger") {
		browserType = "touchstart";
	}else if(ua.indexOf('iphone') > -1 || ua.indexOf('Android') > -1 || ua.indexOf('Linux') > -1 || ua.indexOf('Mac') > -1){
		browserType = "touchstart";
	}else{
		browserType = "click";
	}
	
	$(document).bind('touchstart', function() {
		if (event.target.id == "mask") {
			$(".dialoge").hide();
			$("#mask").hide();
		}
		if (event.target.className == "dialoge_close") {
			$(".dialoge").hide();
			$("#mask").hide();
		}
		if (event.target.className == "dialoge_ture") {
			var cid = $('.coupon_cid').eq(_list).val();
			var stuid = '{$item['sid']}';
			deleteClass(cid, stuid);
			$(".dialoge").hide();
			$("#mask").hide();
			$(".order_unpay > div").eq(_list).remove()
		}

	})
	$(".unpay_li").bind('click', function() {
		$(this).toggleClass("click");
		var unpay_flag = true;
		for (var i = 0; i < $('.unpay_li').length; i++) {
			if (!$('.unpay_li').eq(i).hasClass('click')) {
				unpay_flag = false;
			}
		}
		if (unpay_flag) {
			$('#quanxuan').addClass('click');
		} else {
			$('#quanxuan').removeClass('click');
		}
	})
	$(".order_sum span").bind('click', function() {
		if ($(this).hasClass("click")) {
			$(this).removeClass("click");
			$(".order_unpay .unpay_li").removeClass("click");
		} else {
			$(this).addClass("click");
			for (var j = 0; j < $('.unpay_li').length; j++) {
				if (!$('.unpay_li').eq(j).parent().hasClass('delete')) {
					$('.unpay_li').eq(j).addClass("click");
				}
			}
		}
	})
	$(".order_close").bind('click', function() {
		$("#mask").show();
		$(".dialoge#delete").show();
		_list = $(event.target).index(".order_close");
		event.stopPropagation();
	})

});
function Tijiao() {			
				
		var name = $("#name").val();
		var mobile = $("#mobile").val();
		var is_allowmsg = $("#is_allowmsg").val();
		reg=/^(0|86|17951)?(13[0-9]|15[012356789]|17[0-9]|18[0-9]|14[57])[0-9]{8}$/;
		if (name == "" || name == undefined || name == null) { 
		PB.prompt('请输入您的姓名！');
		return false;
		}
		if (is_allowmsg == "" || is_allowmsg == undefined || is_allowmsg == null) { 
		PB.prompt('请选择是否接收其他家长私聊');
		return false;
		}		
		if (mobile == "" || mobile == undefined || mobile == null || !reg.test(mobile)) {
		PB.prompt('手机号有误或为空！');
		return false;
		} else {
			var	submitData = {
				schoolid:"{$schoolid}",
				name:name,
				userid:userid,
				is_allowmsg:is_allowmsg,
				mobile:mobile
				};
			$.post("{php echo $this->createMobileUrl('indexajax',array('op'=>'useredit'))}",submitData,function(data){

				if(data.result){
					PB.prompt(data.msg);
					location.reload();
				}else{
					PB.prompt(data.msg);	
				}
			},'json');
		}
}	
function Sigeup() {
	$('#user_info').show();
}
function Close(){
   $('#user_info').hide();
}
function WeixinJSHideAllNonBaseMenuItem(){
	if (typeof wx != "undefined"){
		wx.ready(function () {
			
			wx.hideAllNonBaseMenuItem();
		});
	}
}
</script>

</html>